package com.ls.controller.holiday.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDate;

/**
 * @ClassName AddHolidayModel
 * @Description 新增节日model
 * @Author pengyu
 * @Date 2024/6/27 17:14
 * @Version 1.0
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class AddHolidayModel {
    @NotBlank(message = "节日名称不得为空")
    private String holidayName;
    @NotNull(message = "分类id不得为空")
    private Long categoryId;
    @Max(value = 1)
    @Min(value = 0)
    @NotNull(message = "节日类型不得为空")
    private Integer holidayType;
    @Max(value = 1)
    @Min(value = 0)
    private Integer holidaySort;
    /**
     * 1为按年重复，2为按月重复，3为按周重复，4为按天重复，0为不重复
     */
    @Max(value = 4)
    @Min(value = 0)
    private Integer period;
    private Integer periodCount;
    private Long customerId;
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @JSONField(format = "yyyy-MM-dd")
    @NotNull(message = "起始日期不得为空")
    private LocalDate startTime;
}
